﻿using Learun.Util;
using SqlSugar;
using System;
namespace Learun.Application.TwoDevelopment.ZZDT_EC
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-06-21 15:32
    /// 描 述：ec_SofttagEntity
    /// </summary>
    //[Serializable]
    [SugarTable(TableName = "ec_Softtag")]
    [SugarIndex("unique_softtag", nameof(CS_TAG_NAME), OrderByType.Asc, nameof(Wire_Group_ID), OrderByType.Asc, true)]
    public class ec_SofttagEntity
    {
        public ec_SofttagEntity()
        {

        }
        #region 实体成员
        /// <summary>
        /// ID
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsPrimaryKey = true)]
        public string CS_TAG_ID { get; set; }
        /// <summary>
        /// CS_TAG_NAME。即<see cref="ec_Wire_GroupEntity.Code"/>
        /// </summary>
        /// <returns></returns>
        [SugarColumn(IsNullable = false)]
        public string CS_TAG_NAME { get; set; }
        /// <summary>
        /// <see cref="ec_Wire_GroupEntity.Wire_Group_ID"/>
        /// </summary>
        /// <returns></returns>
        public string Wire_Group_ID { get; set; }
        /// <summary>
        /// DESC
        /// </summary>
        /// <returns></returns>
        public string Description { get; set; } = "";
        /// <summary>
        /// DESC 英文
        /// </summary>
        /// <returns></returns>
        public string DescriptionEN { get; set; } = "";
        /// <summary>
        /// ALARM4L_VALUE
        /// </summary>
        /// <returns></returns>
        public string ALARM4L_VALUE { get; set; } = "";
        /// <summary>
        /// ALARM3L_VALUE
        /// </summary>
        /// <returns></returns>
        public string ALARM3L_VALUE { get; set; } = "";
        /// <summary>
        /// ALARM2L_VALUE
        /// </summary>
        /// <returns></returns>
        public string ALARM2L_VALUE { get; set; } = "";

        /// <summary>
        /// ALARM1L_VALUE
        /// </summary>
        /// <returns></returns>
        public string ALARM1L_VALUE { get; set; } = "";

        /// <summary>
        /// ALARM1H_VALUE
        /// </summary>
        /// <returns></returns>
        public string ALARM1H_VALUE { get; set; } = "";

        public string ALARM2H_VALUE { get; set; } = "";

        public string ALARM3H_VALUE { get; set; } = "";

        public string ALARM4H_VALUE { get; set; } = "";
        /// <summary>
        /// AL_GRP
        /// </summary>
        /// <returns></returns>
        public string AL_GRP { get; set; } = "";
        /// <summary>
        /// BL_GRP
        /// </summary>
        /// <returns></returns>
        public string BL_GRP { get; set; } = "";
        /// <summary>
        /// 延时
        /// </summary>
        /// <returns></returns>
        public string Time_Delay { get; set; } = "";

        /// <summary>
        /// VDR_Record
        /// </summary>
        /// <returns></returns>
        public bool VDR_Record { get; set; } = false;

        /// <summary>
        /// 是否为slow down信号
        /// </summary>
        /// <returns></returns>
        public bool SLD { get; set; } = false;

        /// <summary>
        /// 是否为shut down信号
        /// </summary>
        /// <returns></returns>
        public bool SHD { get; set; } = false;
        /// <summary>
        /// Remarks
        /// </summary>
        /// <returns></returns>
        public string Remarks { get; set; } = "";

        /// <summary>
        /// true，代表该信号是单纯的电气专业信息，轮机专业不关心
        /// </summary>
        public bool ElecOnly { get; set; } = false;
        /// <summary>
        /// 创建人
        /// </summary>
        /// <returns></returns>
        public string CreateUserID { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        /// <returns></returns>
        public DateTime? CreateTime { get; set; }
        /// <summary>
        /// 更新人
        /// </summary>
        /// <returns></returns>
        public string UpdateUserID { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        /// <returns></returns>
        public DateTime? UpdateTime { get; set; }
        #endregion

        #region 扩展操作
        /// <summary>
        /// 新增调用
        /// </summary>
        public void Create()
        {
            this.CS_TAG_ID = Guid.NewGuid().ToString();
            this.CreateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.CreateUserID = userInfo.userId;


        }
        /// <summary>
        /// 编辑调用
        /// </summary>
        /// <param name="keyValue"></param>
        public void Modify(string keyValue)
        {
            this.CS_TAG_ID = keyValue;
            this.UpdateTime = Time.MySqlTime;
            UserInfo userInfo = LoginUserInfo.Get();
            this.UpdateUserID = userInfo.userId;
        }
        #endregion

        #region 扩展字段

        [SugarColumn(IsIgnore = true)]
        public ec_Wire_GroupEntity MasterSignal { get; set; }


        #endregion
    }
}

